package spider_lib

import (
    "strconv"
    "regexp"
    "net/http"
)

var mobileUA = "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3"
var mobileHeader = http.Header{
    "User-Agent": []string{mobileUA},
}
var formHeader = http.Header{
    "Content-Type":[]string{"application/x-www-form-urlencoded"},
}
var numre = regexp.MustCompile(`\d+`)
var url_re = regexp.MustCompile(`http://[^"]+\\`)

func ToNum(str string) int {
    num, _ := strconv.Atoi(numre.FindString(str))
    return num
}

func ToStr(num int) string {
    return strconv.Itoa(num)
}